package Service;

import Dao.Impl.AdminDAOImpl;
import Dao.Impl.CarDAOImpl;
import pojo.Car;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class CarService {
    private CarDAOImpl carDAOImpl;

    public CarService() throws Exception {
        carDAOImpl = new CarDAOImpl();
    }

    public List<Car> getAllCars() throws Exception {
        List<Car> carList = carDAOImpl.getAllCars();
        return carList;
    }

    public void deleteCar(int carId) throws SQLException {
        carDAOImpl.deleteCar(carId);
    }

    public List<Car> getCarByBrand(String carBrand) throws SQLException {
        return carDAOImpl.getCarByBrand(carBrand);
    }

    public Boolean addCar(Car car) {
        return carDAOImpl.addCar(car);
    }
}
